//
//  MYNetworkingTool.m
//  MYChatting
//
//  Created by mac on 16/7/30.
//  Copyright © 2016年 lhf. All rights reserved.
//

#import "MYNetworkingTool.h"

@implementation MYNetworkingTool


static MYNetworkingTool *_instance;
+ (instancetype)sharedMYNetworkingTool{
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        _instance = [[self alloc] init];
        _instance.responseSerializer.acceptableContentTypes = [NSSet setWithObjects:@"application/json", @"text/json", @"text/javascript",@"text/plain", nil];
    });
    return _instance;
}


//- (void)loadUserCodeWithURLString:(NSString *)urlStr andDict:(NSDictionary *)dict{
//    [[MYNetworkingTool sharedMYNetworkingTool] POST:urlStr parameters:dict progress:^(NSProgress * _Nonnull uploadProgress) {
//        NSLog(@"%@",uploadProgress);
//    } success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
//        
//    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
//        NSLog(@"%@",error);
//    }];
//    
//}

// MYNetworkingTool sharedMYNetworkingTool] GET:<#(nonnull NSString *)#> parameters:<#(nullable id)#> progress:<#^(NSProgress * _Nonnull downloadProgress)downloadProgress#> success:<#^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject)success#> failure:<#^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error)failure#>



@end
